package util;

import gui.BotGui;

import java.awt.AWTException;
import java.awt.Color;
import java.awt.Robot;

//for the edit page
public class PlacementTest {
	public static void main(String[] args){
		long start = System.currentTimeMillis();
		while (System.currentTimeMillis() - start < 10000){}
		for (int j = 0; j < 10; j++){
			boolean keepGoing = false;
			for (int i = 850; i < 860; i++){
				Robot robo;
				try{
					robo = new Robot();
					//was 290 when wikinic banner was up
					Color test = robo.getPixelColor(i, BotGui.height);
					robo.mouseMove(i, BotGui.height);
					//robo.mouseMove(i, 240);
					int r = test.getRed();
					int g = test.getGreen();
					int b = test.getBlue();
					if (!(r >= 236 && r <= 240)){
						keepGoing = true;
					}
					if (!(g >= 244 && g <= 248)){
						keepGoing = true;
					}
					if (!(b >= 248 && b <= 252)){
						keepGoing = true;
					}
				} 
				catch (AWTException e){
					e.printStackTrace();
				}
			}
			if (!keepGoing){
				System.out.println("found");
				break;
			}
		}
	}
}
